package ssm.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import ssm.dao.ClassMapper;
import ssm.entity.Classs;

@Service
public class ClassService {

	@Autowired
	private ClassMapper classMapper;
	
	/**
	 * 获取一个班级
	 * @param record
	 * @return
	 */
	public Classs getClassByName(Classs record) {
		return classMapper.getClassByName(record);
	}
	
	/**
	 * 获取某个院系的班级
	 * @param dId
	 * @return
	 */
	public List<Classs> getClassByDepartmentId(Integer dId){
		return classMapper.getClassByDepartmentId(dId);
	}
	
	/**
	 * 获取所有班级
	 * @return
	 */
	public List<Classs> allClass(){
		return classMapper.allClass();
	}
	
	/**
	 * 添加班级
	 * @param record
	 * @return
	 */
	public int addClass(Classs record) {
		return classMapper.addClass(record);
	}
	
	/**
	 * 修改班级信息
	 * @param classId
	 * @return
	 */
	public int updateClass(Integer classId) {
		return classMapper.updateClass(classId);
	}
	
	/**
	 * 删除班级
	 * @param classId
	 * @return
	 */
	public int deleteClass(Integer classId) {
		
		return classMapper.deleteClass(classId);
	}
	
	
}
